
/*
 * @Description:Teacher类
 * 
 * @Author: rendc
 * 
 * @Date: 2024-10-17 10:30:28
 * 
 * @LastEditors: rendc
 * 
 * @LastEditTime: 2024-10-17 10:41:58
 */
import java.io.Serializable;

//基础类 必须实现序列化接口 是为了让teacher类的对象可以被序列化和反序列化
public class Teacher implements Serializable {
  // 标识当前类的版本，用于序列化和反序列化时的版本校验
  private static final long serialVersionUID = 1;
  private String name;
  private int age;
  private double salary;

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public int getAge() {
    return age;
  }

  public void setAge(int age) {
    this.age = age;
  }

  public double getSalary() {
    return salary;
  }

  public void setSalary(double salary) {
    this.salary = salary;
  }

  @Override
  public String toString() {
    return "Teacher [name=" + name + ", age=" + age + ", salary=" + salary + "]";
  }
}